From 84fcadeb52a16911bc9f387a617d8b622a04aca4 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 13 Jan 2005 19:37:54 +0000 Subject: [PATCH] Check for nl_langinfo() Use nl_langinfo() when it's available to determine 2005-01-13 Matthias Clasen * configure.in: Check for nl_langinfo() * gtk/gtkcalendar.c: (gtk_calendar_init): Use nl_langinfo() when it's available to determine first day of week (#163842, Vincent Untz) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ configure.in | 2 +- gtk/gtkcalendar.c | 8 ++++++++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7672951b56..fc7d681298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2005-01-13 Matthias Clasen + * configure.in: Check for nl_langinfo() + * gtk/gtkcalendar.c: (gtk_calendar_init): Use nl_langinfo() when it's + available to determine first day of week (#163842, Vincent Untz) + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Add hints about the lifecycle of widgets. (#159503, Christian Persch) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 7672951b56..fc7d681298 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2005-01-13 Matthias Clasen + * configure.in: Check for nl_langinfo() + * gtk/gtkcalendar.c: (gtk_calendar_init): Use nl_langinfo() when it's + available to determine first day of week (#163842, Vincent Untz) + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Add hints about the lifecycle of widgets. (#159503, Christian Persch) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 7672951b56..fc7d681298 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2005-01-13 Matthias Clasen + * configure.in: Check for nl_langinfo() + * gtk/gtkcalendar.c: (gtk_calendar_init): Use nl_langinfo() when it's + available to determine first day of week (#163842, Vincent Untz) + * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Add hints about the lifecycle of widgets. (#159503, Christian Persch) diff --git a/configure.in b/configure.in index 6de77975b1..b6f047e6a7 100644 --- a/configure.in +++ b/configure.in @@ -396,7 +396,7 @@ if test "x$enable_rebuilds" = "xyes" && \ fi AC_SUBST(REBUILD) -AC_CHECK_FUNCS(lstat mkstemp flockfile) +AC_CHECK_FUNCS(lstat mkstemp flockfile nl_langinfo) # sigsetjmp is a macro on some platforms, so AC_CHECK_FUNCS is not reliable AC_MSG_CHECKING(for sigsetjmp) diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c index d048025ae2..0f45c04041 100644 --- a/gtk/gtkcalendar.c +++ b/gtk/gtkcalendar.c @@ -34,6 +34,9 @@ #ifdef HAVE_SYS_TIME_H #include #endif +#ifdef HAVE_NL_LANGINFO +#include +#endif #include #include #include @@ -703,6 +706,10 @@ gtk_calendar_init (GtkCalendar *calendar) else if (strcmp (year_before, "calendar:MY") != 0) g_warning ("Whoever translated calendar:MY did so wrongly.\n"); +#if defined (HAVE_NL_LANGINFO) && defined (_NL_TIME_FIRST_WEEKDAY) + week_start = nl_langinfo (_NL_TIME_FIRST_WEEKDAY); + private_data->week_start = *((unsigned char *) week_start) % 7; +#else /* Translate to calendar:week_start:0 if you want Sunday to be the * first day of the week to calendar:week_start:1 if you want Monday * to be the first day of the week, and so on. @@ -719,6 +726,7 @@ gtk_calendar_init (GtkCalendar *calendar) g_warning ("Whoever translated calendar:week_start:0 did so wrongly.\n"); private_data->week_start = 0; } +#endif } GtkWidget* -- 2.30.2